package com.hp.ssm.service.impl;

import com.github.pagehelper.PageHelper;
import com.hp.ssm.entity.Patient;
import com.hp.ssm.mapper.PatientMapper;
import com.hp.ssm.mapper.PersonMapper;
import com.hp.ssm.service.PatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PatientServiceImpl implements PatientService {
    @Autowired
    public PatientMapper patientMapper;


    @Override
    public List<Patient> showAll2(Integer page, Integer limit,Patient patient) {
        PageHelper.startPage(page, limit);
        return patientMapper.showAll2(patient);
    }

    @Override
    public int fakedel(Integer pid) {
        return patientMapper.fakedel(pid);
    }

    @Override
    public int recover(Integer pid) {
        return patientMapper.recover(pid);
    }

    @Override
    public int add(Patient patient) {
        return patientMapper.add(patient);
    }

    @Override
    public int uid(String pphone) {
        return patientMapper.uid(pphone);
    }

    @Override
    public Patient findId(int pid) {
        return patientMapper.findId(pid);
    }

    @Override
    public int updateStatus(Patient Patient) {
        return patientMapper.updateStatus(Patient);
    }

    @Override
    public int insert(Patient patient) {
        return patientMapper.insert(patient);
    }

    @Override
    public List<Patient> showAll(Integer page, Integer limit,Patient patient) {
        PageHelper.startPage(page, limit);
        return patientMapper.showAll(patient);
    }
}
